<template>
    <!-- pages/setParking1/index.wxml -->
    <view class="body-p">
        <view class="body-p-t">
            <view class="body-p-t-h1">您选择的服务是?</view>
            <view class="body-p-t-h2">根据选择为您提供精准服务</view>
        </view>
        <view class="body-p-c1" @tap="handleTemporary">
            <view class="body-p-c1-bg">
                <image src="../../static/assets/img/ls.png" />
            </view>
            <view class="tag" v-if="active == 0">
                <van-tag type="success">当前共享模式</van-tag>
            </view>
            <view class="body-p-c1-t">
                <view class="body-p-c-h1">闲置时间段临停共享</view>
                <view class="body-p-c-h2">选择车位空闲时段，共享给他人</view>
                <!-- <view class="body-p-c-h2">按时计算</view> -->
            </view>
        </view>
        <view class="body-p-c2" @tap="handleMonth">
            <view class="body-p-c1-bg">
                <image src="../../static/assets/img/month.png" />
            </view>
            <view class="tag" v-if="active == 1">
                <van-tag type="warning">当前共享模式</van-tag>
            </view>
            <view class="body-p-c1-t">
                <view class="body-p-c-h1">车位按月出租</view>
                <view class="body-p-c-h2">按整月出租</view>
                <!-- <view class="body-p-c-h2">平台统一定价100元/月</view> -->
            </view>
        </view>
    </view>
</template>

<script>
// pages/setParking1/index.js
export default {
    data() {
        return {
            active: 0,
            //0--临时，1--月，2--新的
            id: null
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        // console.log(options)
        if (options.id) {
            this.setData({
                id: options.id
            });
        }

        if (options.active) {
            this.setData({
                active: options.active
            });
        }
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    // onShareAppMessage: function() {}
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */ methods: {
        handleTemporary() {
            if (this.active == 0) {
                uni.navigateTo({
                    url: '../setParking2/index?id=' + this.id
                });
            } else {
                uni.navigateTo({
                    url: '../setParking2/index'
                });
            }
        },

        handleMonth() {
            if (this.active == 1) {
                uni.navigateTo({
                    url: '../setParking3/index?id=' + this.id
                });
            } else {
                uni.navigateTo({
                    url: '../setParking3/index'
                });
            }
        }
    }
};
</script>
<style>
@import './index.css';
</style>
